package com.acoreful.ackitcloud.controller;

import cn.hutool.core.lang.Console;
import cn.hutool.core.util.IdUtil;

import com.acoreful.ackitcloud.common.trim.Trimmed;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "TestController",description = "")
@RestController
@RequestMapping("test")
@Validated
public class TestController {

    @Operation(summary = "sayHi",description = "sdsdsds")
    @GetMapping("sayHi")
    public String sayHi(){
        return IdUtil.fastUUID();
    }

    @PostMapping("testParams")
    public String testParams(@Trimmed(value = Trimmed.TrimmerType.EXCEPT_LINE_BREAK) @Length(min=50,max = 200) String name){
        Console.log(name);
        return name;
    }
}
